package com.yu.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yu.bean.User;
import com.yu.dao.UserDAO;
import com.yu.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDAO userDAO;
	
	@Override
	public int add(User user) {
		return userDAO.add(user);
	}

	@Override
	public int update(User user) {
		return userDAO.update(user);
	}

	@Override
	public int delete(int id) {
		return userDAO.delete(id);
	}

	@Override
	public List<User> getAll() {
		return userDAO.getAll();
	}

	@Override
	public User getById(int id) {
		return userDAO.getById(id);
	}
	
	@Override
	public int doLogin(User user) {
		return userDAO.doLogin(user);
	}

	@Override
	public int checkName(String username) {
		return userDAO.checkName(username);
	}
}
